{% extends "base.volt" %}

        {% block pageFooter%}
        {{ javascript_include("/js/area.js", false) }}
        {{ javascript_include("/assets/manage/js/areaAdd.js", false) }}
        {{ javascript_include("/assets/manage/js/question_recommend/list.js", false) }}
        {% endblock %}

        {% block content %}
        {{ partial("module/left_question") }}

<div class="col-xs-10">
    <ol class="breadcrumb">
        <li><a href="{{ url.get('question/list') }}">问答</a></li>
        <li><a href="{{ url.get('question/list') }}">问答管理</a></li>
        <li class="active">首页问答推荐</li>
    </ol>

    <div class="panel panel-default">
        <div class="panel-body">
            <form class="form-inline" role="form" action="" method="get">

                <div class="form-group pull-right">
                	<div class="input-group">
                        <label class="input-group-addon">问题内容</label>
                        <input type="text" class="form-control" name="qcontent" value="{{ qcontent }}" >
                    </div>
                    <div class="input-group">
                        <label class="input-group-addon">市</label>
                        <select class="form-control" name="filterCity" id="filterCity" dvalue="{{ filterCity|escape_attr }}">
                                <option value="-1" {{ filterCity == -1 ? 'selected="selected"' : '' }} >全部</option>
                                <option value="0" {{ filterCity == 0 ? 'selected="selected"' : '' }} >全国</option>
                                {% for oc in openCity %}
                                    <option value="{{ oc.city_id }}" {{ filterCity == oc.city_id ? 'selected="selected"' : '' }} >{{ oc.city_name|e }}</option>
                                {% endfor %}
                        </select>
                    </div>
                    <button type="submit" class="btn btn-primary"><i class="fa fa-filter"></i> 搜 索</button>
                </div>

<div class="form-group">
<div class="input-group">
    <a class="btn btn-primary" href="{{ url.get('question/question_recommend_add') }}">添加推荐问答</a>
</div>
</div>

        </form>
        </div>
        </div>
<?php if($_GET['filterCity']!=''){?>
<table class="table table-hover edit_edit">
<thead>
<tr>
    <th style="">问题ID</th>
    <th >问题内容</th>
    <!--<th style="">问题图片</th>
    <th >首页标题</th> -->
    <th style="">城市</th>
    <th>推荐排序</th>
    <th style="">操作</th>
</tr>
</thead>
<?php foreach ($list as $r){ ?>
<tr>
    <td><?=$r['q_id']?></td>
    <td>
    {% if unserialize(base64_decode(r['question_content'])) %}
    {{ unserialize(base64_decode(r['question_content'])) }}
    {% else %}
    {{ r['question_content'] }}
    {% endif %}
    </td>
    <!--<td><img src="http://img.meelier.com/<?=$r['img_url']?>" width="50px" height:50px;></td>
    <td><?=$r['title']?></td> -->
    <td><?=$r['city_name']?></td>
    <td><?=$r['sort']?></td>
    <td><a class="btn btn-default" href="{{url.get('Question/calloff')}}?id=<?=$r['id']?>&city_id=<?=$_GET['filterCity']?>">取消推荐</a> </td>
</tr>
<?php }?>
</table>
{{ this.tagNav.page(
        page,
        total,
        limit,
        url.get('question/question_recommend_list', [
            'filterName': filterName,
            'filterProvince': filterProvince,
            'filterCity': filterCity,
            'filterDistrict': filterDistrict,
            'filterState': filterState,
            'filterSell': filterSell,
            'filterMedal': filterMedal,
            'page': '__PAGE__'
        ]
    )) }}
<?php }?>

        </div>
        {% endblock %}